package com.linkage.educloud.ah.bean;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Mr'Tang on 2018/9/10.
 */

public class AppBean implements Serializable {
    private static final long serialVersionUID = 1L;
    private String id;
    private String name;
    private String logo;
    private String url;
    private String ersion;
    private String type;
    private String order_num;
    private String inapp_mode;
    private String inapp_notice;
    private String order_mode;
    private String introduction;
    private String source_id;
    private String launcher_path;
    private String launcher_act;
    private String typeId;
    private String version;
    private String price_type;
    private String price;
    private String price_me;
    private String service_id;
    private String overdue;


    public String getOverdue() {
        return overdue;
    }
    public void setOverdue(String overdue) {
        this.overdue = overdue;
    }
    public String getPrice_type() {
        return price_type;
    }
    public void setPrice_type(String price_type) {
        this.price_type = price_type;
    }
    public String getPrice() {
        return price;
    }
    public void setPrice(String price) {
        this.price = price;
    }
    public String getPrice_me() {
        return price_me;
    }
    public void setPrice_me(String price_me) {
        this.price_me = price_me;
    }
    public String getService_id() {
        return service_id;
    }
    public void setService_id(String service_id) {
        this.service_id = service_id;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
    public String getTypeId() {
        return typeId;
    }
    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }
    public String getLauncher_path() {
        return launcher_path;
    }
    public void setLauncher_path(String launcher_path) {
        this.launcher_path = launcher_path;
    }
    public String getLauncher_act() {
        return launcher_act;
    }
    public void setLauncher_act(String launcher_act) {
        this.launcher_act = launcher_act;
    }
    public String getSource_id() {
        return source_id;
    }
    public void setSource_id(String source_id) {
        this.source_id = source_id;
    }
    public String getIntroduction() {
        return introduction;
    }
    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }
    public String getOrder_mode() {
        return order_mode;
    }
    public void setOrder_mode(String order_mode) {
        this.order_mode = order_mode;
    }
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getLogo() {
        return logo;
    }
    public void setLogo(String logo) {
        this.logo = logo;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getErsion() {
        return ersion;
    }
    public void setErsion(String ersion) {
        this.ersion = ersion;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getOrder_num() {
        return order_num;
    }
    public void setOrder_num(String order_num) {
        this.order_num = order_num;
    }
    public String getInapp_mode() {
        return inapp_mode;
    }
    public void setInapp_mode(String inapp_mode) {
        this.inapp_mode = inapp_mode;
    }
    public String getInapp_notice() {
        return inapp_notice;
    }
    public void setInapp_notice(String inapp_notice) {
        this.inapp_notice = inapp_notice;
    }

    public static List<AppBean> parseFromJson(JSONArray jsonArray){
        List<AppBean> list = new ArrayList<>();
        for (int a = 0; a < jsonArray.length(); a++) {
            AppBean apphot = new AppBean();
            JSONObject obj = null;
            try {
                obj = jsonArray.getJSONObject(a);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            apphot.setErsion(obj.optString("ersion"));
            apphot.setId(obj.optString("id"));
            apphot.setName(obj.optString("name"));
            apphot.setLogo(obj.optString("logo"));
            apphot.setOrder_num(obj.optString("order_num"));
            apphot.setType(obj.optString("type"));
            apphot.setUrl(obj.optString("url"));
            apphot.setInapp_mode(obj.optString("inapp_mode"));
            list.add(apphot);
        }
        return list;
    }
}

